#!/usr/bin/python
# -*- coding:utf-8 -*-

import pandas as pd

class WellTrajectoryData:
    def __init__(self, series=None, **kwargs):
        print(f"初始化 WellTrajectoryData: {self.__dict__}")  # 调试信息
        if series is not None:
            # 从 pandas.Series 初始化属性
            self.well_depth = series.get('井深', 0.0)
            self.well_slope = series.get('井斜', 0.0)
            self.azimuth = series.get('方位', 0.0)
            self.vertical_depth = series.get('垂深', 0.0)
            self.ns_coordinates = series.get('南北坐标', 0.0)
            self.ew_coordinates = series.get('东西坐标', 0.0)
            self.closed_orientation = series.get('闭合方位', 0.0)
            self.closed_displacement = series.get('闭合位移', 0.0)
            self.eye_displacement = series.get('视平位移', 0.0)
            self.dogleg_degree = series.get('狗腿度', 0.0)
            self.ordinate = series.get('纵坐标(X)', 0.0)
            self.abscissa = series.get('横坐标(Y)', 0.0)
        else:
            # 使用关键字参数初始化属性
            self.well_depth = kwargs.get('well_depth', 0.0)
            self.well_slope = kwargs.get('well_slope', 0.0)
            self.azimuth = kwargs.get('azimuth', 0.0)
            self.vertical_depth = kwargs.get('vertical_depth', 0.0)
            self.ns_coordinates = kwargs.get('ns_coordinates', 0.0)
            self.ew_coordinates = kwargs.get('ew_coordinates', 0.0)
            self.closed_orientation = kwargs.get('closed_orientation', 0.0)
            self.closed_displacement = kwargs.get('closed_displacement', 0.0)
            self.eye_displacement = kwargs.get('eye_displacement', 0.0)
            self.dogleg_degree = kwargs.get('dogleg_degree', 0.0)
            self.ordinate = kwargs.get('ordinate', 0.0)
            self.abscissa = kwargs.get('abscissa', 0.0)

    def __str__(self):
        return (f"井深: {self.well_depth}, 井斜: {self.well_slope}, 方位: {self.azimuth}, 垂深: {self.vertical_depth}, "
                f"南北坐标: {self.ns_coordinates}, 东西坐标: {self.ew_coordinates}, 闭合方位: {self.closed_orientation}, "
                f"闭合位移: {self.closed_displacement}, 视平位移: {self.eye_displacement}, 狗腿度: {self.dogleg_degree}, "
                f"纵坐标(X): {self.ordinate}, 横坐标(Y): {self.abscissa}")
